package com.tbit.main.service.impl;

import com.tbit.main.dao.core.HelmetDao;
import com.tbit.main.pojo.Helmet;
import com.tbit.main.service.HelmetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @author LMY
 * @create 2022-09-22 15:20
 */
@Service
public class HelmetServiceImpl implements HelmetService {

    @Autowired
    private HelmetDao helmetDao;


    @Override
    public Helmet getMac(String Mac) {
        return helmetDao.getMac(Mac);
    }

    @Override
    public void delHelmetMac(String helmetMac) {
        helmetDao.delHelmetMac(helmetMac);
    }

    @Override
    public void insert(Helmet helmet) {
        helmetDao.insert(helmet);
    }

    @Override
    public void updateState(String helmetMac, Integer status) {
        Map<String, Object> map = new HashMap<>();
        map.put("helmetMac", helmetMac);
        map.put("status", status);
        helmetDao.updateState(map);
    }
}
